package com.eagle.scali.usercenter.feignclient.fallbackfactory;


import com.eagle.scali.usercenter.domain.dto.content.ShareDTO;
import com.eagle.scali.usercenter.feignclient.ContentCenterFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class ContentCenterFeignClientFallbackFactory implements FallbackFactory<ContentCenterFeignClient> {
    @Override
    public ContentCenterFeignClient create(Throwable cause) {
        return new ContentCenterFeignClient() {
            @Override
            public List<ShareDTO> findShareListByUserIds(List<String> userIds) {
                log.warn("远程调用被限流/降级了", cause);
                return null;
            }


        };
    }
}
